package com.moli.iov.base.model;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.moli.iov.base.model.po.VehicleAttention;
import com.moli.iov.base.util.CollectionUtils;
import java.util.List;
import org.apache.commons.lang3.StringUtils;

/**
 * @author whl
 */
public class VehicleAttentionParam {

  private QueryWrapper<VehicleAttention> queryWrapper;

  public VehicleAttentionParam() {
    queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("is_delete", 0);
  }

  public QueryWrapper<VehicleAttention> get() {
    return queryWrapper;
  }


  public VehicleAttentionParam queryEqVin(String vin) {
    if (!StringUtils.isEmpty(vin)) {
      queryWrapper.eq("vin", vin);
    }
    return this;
  }

  public VehicleAttentionParam queryInVin(List<String> vinList) {
    if (!CollectionUtils.isEmpty(vinList)) {
      queryWrapper.in("vin", vinList);
    }
    return this;
  }
  public VehicleAttentionParam queryEqUserId(Long userId) {
    if (userId != null) {
      queryWrapper.eq("user_id", userId);
    }
    return this;
  }

  public VehicleAttentionParam queryEqGroupId(Long groupId) {
    if (groupId != null) {
      queryWrapper.eq("group_id", groupId);
    }
    return this;
  }

  public VehicleAttentionParam queryEqCompanyId(Long companyId) {
    if (companyId != null) {
      queryWrapper.eq("company_id", companyId);
    }
    return this;
  }

}
